package org.haq.bae.datamodel;

/**
 * User: abilhakim
 * Date: 5/8/12
 * Time: 2:22 AM
 */
public class QueryModel extends EntityModel implements Validatable {

    public QueryModel(String id, String query) {

        super(id, query);
        if (!isValid()) {
            throw new IllegalArgumentException("id must be started with q_ for query");
        }

    }

    @Override
    public boolean isValid() {
        if (id != null && id.startsWith("q_")) {
            return true;
        }
        return false;
    }
}
